package org.gruposp2p.proyectokarma.gwt.client.event;

import org.gruposp2p.proyectokarma.gwt.client.domain.CometdMessage;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;

public class CometdEvent extends GwtEvent {

    private static final GwtEvent.Type TYPE = new GwtEvent.Type();

    public CometdMessage cometdMessage;
	
	public CometdEvent (CometdMessage cometdMessage) {
		this.cometdMessage = cometdMessage;
	}
	
    public static GwtEvent.Type getType(){ return TYPE;}
	
    /**
     * Implemented by handlers of this type of event.
     */
    public interface Handler extends EventHandler {
    	void onCometdEvent(CometdEvent event);
    }

    @Override
    public Type getAssociatedType() { return TYPE;}

	@Override
	protected void dispatch(EventHandler handler) {
    	((CometdEvent.Handler)handler).onCometdEvent(this);
	}
	
}
